#ifndef DATAFLOW_DETAIL_NODELINKDESCRIPTOR_H
#define DATAFLOW_DETAIL_NODELINKDESCRIPTOR_H

namespace DataFlow
{

namespace Detail
{

class Node;

class NodeLinkDescriptor
{
	public:

		typedef void               BaseType;
		typedef NodeLinkDescriptor ThisType;

		NodeLinkDescriptor(void) : sp(0), tp(0), lc(0) { ; }

		NodeLinkDescriptor(int sourcePort, int targetPort, int capacity)
			: sp(0), tp(0), lc(0)
		{
			this->setup(sourcePort, targetPort, capacity);
		}

		void   setSourcePort (int p)          { this->sp = p;    }
		int    sourcePort    (void)     const { return this->sp; }

		void   setTargetPort (int p)          { this->tp = p;    }
		int    targetPort    (void)     const { return this->tp; }

		void   setCapacity   (int c)          { this->lc = ((c < 0) ? (0) : (c)); }
		int    capacity      (void)     const { return this->lc; }

		void setup(int sourcePort, int targetPort, int capacity)
		{
			this->setSourcePort(sourcePort);
			this->setTargetPort(targetPort);
			this->setCapacity(capacity);
		}

	protected:

		int sp;
		int tp;
		int lc;
};

}

}

#endif // DATAFLOW_DETAIL_NODELINKDESCRIPTOR_H
